<%@ page import="java.util.Date" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: 任宝顺
  Date: 2022/3/5
  Time: 13:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>展示饮品信息</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/style.css" />
</head>
<body>
<div id="wrap">
    <div id="top_content">
        <div id="header">
            <div id="rightheader">
                <p>
                    2022-3-6
                    <br />
                </p>
            </div>
            <div id="topheader">
                <h1 id="title">
                    <a href="#">main</a>
                </h1>
            </div>
            <div id="navigation">
            </div>
        </div>
        <div id="content">
            <p id="whereami">
            </p>
            <h1>
                Welcome!
            </h1>
            <form method="post" action="${pageContext.request.contextPath}/grang/deleteMany.do">
                <table class="table">
                    <tr class="table_header">
                        <td>
                            全选
                        </td>
                        <td>
                            编号
                        </td>
                        <td>
                            饮品名称
                        </td>
                        <td>
                            饮品价格
                        </td>
                        <td>
                            上架时间
                        </td>
                        <td>
                            类别名称
                        </td>
                        <td>
                            操作
                        </td>
                    </tr>
                    <c:forEach items="${teas}" var="tea">
                        <tr>
                            <td>
                                <input type="checkbox" name="ids" value="${tea.teaId}"/>
                            </td>
                            <td>
                                    ${tea.teaId}
                            </td>
                            <td>
                                    ${tea.teaName}
                            </td>
                            <td>
                                    ${tea.teaPrice}
                            </td>
                            <td>
                                <fmt:formatDate value="${tea.addTime}" type="both"/>
                            </td>
                            <td>
                                    ${tea.category.categoryName}
                            </td>
                            <td>
                                <a href="${pageContext.request.contextPath}/grang/deleteTea.do?id=${tea.teaId}">删除饮品</a>&nbsp;
                                <a href="${pageContext.request.contextPath}/grang/selectTeaById.do?teaId=${tea.teaId}">修改饮品</a>
                            </td>
                        </tr>
                    </c:forEach>

                </table>
                <input type="submit" value="删除勾选项"/>
            </form>
            <p>
                <a href="${pageContext.request.contextPath}/grang/selectAllCategoryInsert.do">添加饮品</a>
                <a href="${pageContext.request.contextPath}/grang/selectAllCategory.do">查看所有类别</a>
            </p>
        </div>
    </div>
    <div id="footer">
        <div id="footer_bg">
            ABC@126.com
        </div>
    </div>
</div>
</body>
</html>
